Skip to content

Conversation

@lucia-agullo-marti
Copy link

GitLab

Username: martilo


Project Build and Packaging Instructions

1. Start the Docker Container

Ensure the Docker container is build and running. For example:

docker build -t cpackexample-image .
docker run --rm -it --mount type=bind,source="$(pwd)",target=/mnt/cpack-exercise cpackexample-image
cd /mnt/cpack-exercise

All of the following steps are executed inside the container.

2. Build the project

Run the following commands inside the container:

mkdir -p build
cd build
cmake ..
make -j$(nproc)

3. Create the packages

To create distribution packages run:

make package

This will generate:

  • tar.gz archive: cpackexample-1.0.0.tar.gz
  • Devian package: cpackexample-1.0.0.deb

4. Install the Debian package

Install the package using:

apt install ./cpackexample-1.0.0.deb

The executable cpackexample will be installed to /usr/local/bin/. You can run it with:

cpackexample

Notes:

  • Header files are installed to /usr/local/include/cpackexamplelib/
  • Static library is installed to /usr/local/lib/libcpackexample.lib.a

5. Inspect the Debian package with lintian

Check the Debian package for errors and warnings with:

lintian ./cpackexample-1.0.0.deb > lintian_report.txt
cat lintian_report.txt

This generates a report of possible issues.

- Install the cpackexample executable to <prefix>/bin
- Install libcpackexamplelib.a/.so library to <prefix>/bin
- Install header files (fem.hpp, filesystem.hpp, flatset.hpp,
  yamlParser.hpp)
- Verified with 'make install' that all files are installed correctly
- Add 'include(cmake/CPackConfig.make)' to CMakeLists.txt to enable
  packaging
- Add 'include(CPack)' to finalize CPack integration
- Create cmake/CPackConfig.cmake to enable packaging with CPack
- Configure TGZ and DEB package generation
- Set package metadata: maintainer, vendor, descripiton, homepage
- Enable stripping of binaries and Debian dependency resolution
- Verifiy that 'make pagage' generates .tar.gz and .deb files containing
  correct content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant